package com.example.demo.service;



import com.example.demo.mapper.OrderMapper;
import com.example.demo.model.OrderInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;

@Service
public class OrderService implements OrderMapper {

    @Autowired
    private OrderMapper orderMapper;


    public int createOrder(int uid,int pid,int quantity,int unitPrice,String traceNo,int totalPrice) {
        return orderMapper.createOrder(uid,pid,quantity,unitPrice,traceNo,totalPrice);
    }

    public int updateOrderstatus(String traceNo,String paymentTime) {
        return orderMapper.updateOrderstatus(traceNo,paymentTime);
    }

    public List<OrderInfo> getOrderByStatus(int uid,String status) {
        return orderMapper.getOrderByStatus(uid,status);
    }

    //从评论表中获取订单状态
    public List<OrderInfo> getOrderByStatus1(int uid,String status) {
        return orderMapper.getOrderByStatus1(uid,status);
    }

    public List<OrderInfo> getAllOrder(int uid) {
        return orderMapper.getAllOrder(uid);
    }

    public List<OrderInfo> getOrderById(int uid,int pid,String traceNo) {
        return orderMapper.getOrderById(uid,pid,traceNo);
    }


}
